package com.xyxe.domain.strategy.model.entity;


import com.xyxe.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * 规则动作实体
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity <T extends RuleActionEntity.RaffleEntity>{

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;

    static public class RaffleEntity {

    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    // 抽奖前
    static public class RaffleBeforeEntity extends RaffleEntity {
        // 策略ID
        private Long strategyId;
        // 权重值key：用于抽奖时可选择权重进行抽奖
        private String ruleWeightValueKey;
        // 黑名单指定奖品ID
        private Integer awardId;
    }

    // 抽奖中
    static public class RaffleCenterEntity extends RaffleEntity {}

    // 抽奖后
    static public class RaffleAfterEntity extends RaffleEntity {}
}
